process.on("message", (msg) => {
  console.log("Message from parent:", msg);
});

let counter = 0;
console.log(`child process pid ${process.pid}`);
setInterval(() => {
  process.send({ counter: counter++ });
}, 1000);
